package com.blog.dto;

/**
 * code
 *
 * @author: garyme
 * @date: 2025/3/25 13:13
 * @description:
 */
public class Result <T> {
    private Integer code;
    private String msg;
    private T data;
    public static <T> Result<T> success(T data) {
        return new Result<>(200, "success", data);
    }
    public static <T> Result<T> error(Integer code, String msg) {
        return new Result<>(code, msg, null);
    }
    private Result(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

}
